using System;
using System.ServiceModel;
using System.Runtime.Serialization;
using Metro.Admin.BusinessEntities;
using System.Collections.Generic; 

namespace Metro.CurrenciesService
{
    [ServiceContract(Namespace = "http://currecies.dataifx.com", SessionMode = SessionMode.Required, CallbackContract = typeof(INotificationContract))]
    public interface INotification
    {
        [OperationContract(IsOneWay = false, IsInitiating = true)]
        void Subscribe();
        [OperationContract(IsOneWay = false, IsTerminating = true)]
        void Unsubscribe();
        [OperationContract(IsOneWay = true)]
        void PublishOrderChange(OrderOperation operation, Order order);
        [OperationContract(IsOneWay = true)]
        void PublishTransactionsChange(TransaccionOperation operation, List<Transaction> transactions);
        [OperationContract(IsOneWay = true)]
        void PublishParameterChange(List<Parameter> parameterList);
    }

    public interface INotificationContract
    {
        [OperationContract(IsOneWay = true)]
        void OrderChange(OrderOperation operation,Order order);
        [OperationContract(IsOneWay = true)]
        void TransactionsChange(TransaccionOperation operation, List<Transaction> transactions);
        [OperationContract(IsOneWay = true)]
        void ParameterChange(List<Parameter> parameterList);
        [OperationContract(IsOneWay = true)]
        void StatsChange(Stats stats);
    }

    public class OrderChangeEventArgs : EventArgs
    {
        public Order order;
        public OrderOperation operation;
    }

    public class TransactionsChangeEventArgs : EventArgs
    {
        public List<Transaction> transactions;
        public TransaccionOperation operation;
    }

    public class ParametersChangeEventArgs : EventArgs 
    {
        public List<Parameter> parameterList;  
    }

    public class StatsChangeEventArgs : EventArgs
    {
        public Stats stats;
    }
}
